package com.candy.candyproduct.controller;

import com.candy.candycommon.utils.ResultBean;
import com.candy.candyshortlinkservice.service.ShortLinkService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author suYanLong
 * @version 1.0
 * @date 2023/12/26 16:16
 * @Description 描述
 */
@Slf4j
@RestController
@RequestMapping("shortLink")
@AllArgsConstructor
public class VisitShortLinkController {

    private final ShortLinkService shortLinkService;

    @GetMapping("getById")
    public ResultBean getByOrderId(@RequestParam Long id) {
        if (id == null) {
            return ResultBean.error("id不能为空！");
        }
        log.info("=============id============");
        return shortLinkService.getById(id);
    }

}
